package com.heima.user.controller;

import com.heima.model.common.dtos.LoginDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.ApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("app用户登录管理")
@RestController
@RequestMapping("/api/v1/login")
@Slf4j
public class UserController {

    @Autowired
    private ApUserService apUserService;

    /**
     * app用户登录
     * @param loginDto
     * @return
     */
    @ApiOperation("app用户登录接口")
    @PostMapping("/login_auth")
    public ResponseResult userLogin(@RequestBody LoginDto loginDto){
        log.info("app用户登录接口，入参={}",loginDto);
        return apUserService.userLogin(loginDto);
    }
}
